#ifndef GREEN_TYPES_H
#define GREEN_TYPES_H

#include <stdint.h>

typedef double					FloatingPoint;
typedef long long int			Integer;
typedef void*					StringRef;
typedef unsigned short int		StringID;
typedef unsigned short int		Ammount;
typedef short int				Offset;
typedef unsigned char*			CommandPosition;
typedef unsigned short int		FunctionID;
typedef uint32_t				Quantity;

typedef struct {//GeneralStackElement
				union {
					FloatingPoint valueD;
					Integer valueI;
					StringRef valueS;
				};
				} GeneralStackElement, *PGeneralStackElement;

typedef struct {//ContextStackElement
				PGeneralStackElement variables;
				CommandPosition retPosition;
				Ammount varAmmount;
				FunctionID id;
				} ContextStackElement, *PContextStackElement;

typedef struct GSLE {//GeneralStackListElement
				struct GSLE* nextElement;
				union {
					FloatingPoint valueD;
					Integer valueI;
					StringRef valueS;
				};
				} GeneralStackListElement, *PGeneralStackListElement;

typedef struct CSLE {//ContextStackListElement
				struct CSLE* nextElement;
				PGeneralStackElement variables;
				CommandPosition retPosition;
				Ammount varAmmount;
				Ammount argAmmount;
				FunctionID id;
				} ContextStackListElement, *PContextStackListElement;

typedef struct FUNCS {//FUNCtionS
				char *signature;
				unsigned char *bytecode;
				Quantity bytecodeSize;
				Quantity varAmmount;
				Quantity argAmmount;
				FunctionID id;
				} Functions, *PFunctions;

typedef struct GSP {//GeneralStackPools
				struct GSP* nextPool;
				PGeneralStackListElement pool;
				} GeneralStackPools, *PGeneralStackPools;

typedef struct {//DynamicStacksInterpreterResult
				PGeneralStackPools generalStackPoolsSet;
				PContextStackListElement contextStackSet;
				unsigned char *instruction;
				int retcode;
				} DSIResult, *PDSIResult;

#endif
